};
DBus.proxifyPrototype(Inhibitor.prototype, InhibitorIface);
Signals.addSignalMethods(Inhibitor.prototype);
+
+
+// Not the full interface, only the methods we use
+const SessionManagerIface = {
+ name: 'org.gnome.SessionManager',
+ methods: [
+ { name: 'Logout', inSignature: 'u', outSignature: '' },
+ { name: 'Shutdown', inSignature: '', outSignature: '' }
+ ]
+};
+
+function SessionManager() {
+ this._init();
+}
+
+SessionManager.prototype = {
+ _init: function() {
+ DBus.session.proxifyObject(this, 'org.gnome.SessionManager', '/org/gnome/SessionManager');
+ }
+};
+DBus.proxifyPrototype(SessionManager.prototype, SessionManagerIface);
\ No newline at end of file
this._user = this._gdm.get_user(GLib.get_user_name());
this._presence = new GnomeSession.Presence();
this._presenceItems = {};
+ this._session = new GnomeSession.SessionManager();
this._account_mgr = Tp.AccountManager.dup()
_onQuitSessionActivate: function() {
Main.overview.hide();
- Util.spawn(['gnome-session-quit', '--logout']);
+ this._session.LogoutRemote(0);
},
_onSuspendOrPowerOffActivate: function() {
this._upClient.suspend_sync(null);
}));
} else {
- Util.spawn(['gnome-session-quit', '--power-off']);
+ this._session.ShutdownRemote();
}
},